/**
 * Created by lincong on 14-六月-18 16:37.
 */
define(function (require, exports, module) {

	var Component = require("Firebird.ui.Component");

//	var defaults = {
//		renderTo: 'body',
//		type: 0,
//		autoClose: true,
//		removeOthers: true,
//		time: undefined,
//		top: 10,
//		onClose: null,
//		onShow: null
//	}
//	this.options = $.extend({}, defaults, options);
//	this._init();
//
//	!Public.Tips._collection ? Public.Tips._collection = [this] : Public.Tips._collection.push(this);

	/**
	 * Firebird.ui.Tips
	 * @class Firebird.ui.Tips
	 */
	Firebird.define("Firebird.ui.Tips", {
		extend: "Firebird.ui.Component",
		statics: {
			_collection: []
		},
		config: {
			renderTo: null,
			type: null,
			autoClose: null,
			removeOthers: null,
			time: null,
			top: null,
			onClose: null,
			onShow: null,
			content: null
		},
		renderTo: 'body',
		type: 0,
		autoClose: true,
		removeOthers: true,
		time: 5000,
		top: 10,
		onClose: function () {
		},
		onShow: function () {
		},
		remove: function () {
		},
		content: "提示",
		/**
		 * initialize after constructor
		 * @private
		 */
		_init: function () {
			switch (this.getType()) {
				case "success":
				case "info":
				case "alert":
					this.setType(0);
					break;
				case "warning":
					this.setType(2);
					break;
				case "error":
					this.setType(1);
					break;
				default:
					break;
			}
			if (Public && Public.Tips) {
				firebird.info({
					// renderTo: this.getRenderTo(),
					type: this.getType(),
					autoClose: this.getAutoClose(),
					removeOthers: this.getRemoveOthers(),
					time: this.getTime(),
					top: this.getTop(),
					onClose: this.getOnClose(),
					onShow: this.getOnShow(),
					content: this.getContent()
				});
				this.instance = new Public.Tips({
					// renderTo: this.getRenderTo(),
					type: this.getType(),
					autoClose: this.getAutoClose(),
					removeOthers: this.getRemoveOthers(),
					time: this.getTime(),
					top: this.getTop(),
					onClose: this.getOnClose(),
					onShow: this.getOnShow(),
					content: this.getContent()
				});
			} else {
				firebird.warn('实例化 [Firebird.ui.Tips] 时找不到依赖环境，见 firebird.data.get("public");');
			}

		}
	});

	module.exports = Firebird.ui.Tips;

});